package com.dreamstall.xiaome;

import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang3.StringUtils;


public class Word {

	private String word = "";
	private String pronunciation = "";
	private Set<String> means = new HashSet<String>();

	public String getWord() {
		return word;
	}

	public void setWord(String word) {
		this.word = word;
	}

	public String getPronunciation() {
		return pronunciation;
	}

	public void setPronunciation(String pronunciation) {
		this.pronunciation = pronunciation;
	}

	public Set<String> getMeans() {
		return means;
	}

	public void setMeans(Set<String> means) {
		this.means = means;
	}
	public String getMeansHtml(){
		String html = "" ;
		for(String s:means){
			if(StringUtils.isNotBlank(s))
				html+=s+"<br>";
		}
		
		return html ;
	}
	

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		String ret = word;
		if (!pronunciation.equals(""))
			ret += " " + pronunciation;
		for (String s : means)
			if (!s.equals(""))
				ret += " " + s;
		return ret;
	}

	@Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		String mean = "";
		for (String s : means)
			mean += s;
		return mean.equals(obj);
	}

}
